Maps an
IO-performing function over any
Traversable data
type, performing all the
IO actions concurrently, and
returning the original data structure with the arguments replaced by
the results.
If any of the actions throw an exception, then all other actions are
cancelled and the exception is re-thrown.
For example,
mapConcurrently works with lists:
pages <- mapConcurrently getURL ["url1", "url2", "url3"]
Take into account that
async will try to immediately spawn a
thread for each element of the
Traversable, so running this
on large inputs without care may lead to resource exhaustion (of
memory, file descriptors, or other limited resources).